<%inherit file="base.html"/>

<%def name="head()">
<script>
    function deleteOperator(operator_id)
    {
        if(confirm("确认删除吗？"))
        {
            window.location.href = "/admin/operator/delete?operator_id="+operator_id;
        }
    }
</script>
</%def>

<%def name="body()">
<section class="content">
    <div class="box box-default">
        <div class="box-header">
            <i class="fa fa-users"></i>
            <h3 class="box-title">操作员信息列表</h3>
        </div>
        <div class="box-body">
            <div class="container">
                % if current_user.opr_type == 0:
                <div class="pull-left bottom10">
                     <a href="/admin/operator/add" class="btn btn-sm bg-navy">增加操作员信息</a>
                </div>
                % endif

                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>操作员名称</th>
                            <th>操作员姓名</th>
                            <th>操作员状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        % for operator in operator_list:
                            <tr>
                                <td>${operator.operator_name}</td>
                                <td>${operator.operator_desc}</td>
                                <td>${opr_status[operator.operator_status]}</td>

                                <td>
                                % if operator.operator_type == 1:
                                    <a class="opt-btn btn-default" href="/admin/operator/update?operator_id=${operator.id}">修改</a>
                                    <a class="opt-btn btn-default" href="javascript:deleteOperator('${operator.id}')">删除</a>
                                %endif
                                </td>

                            </tr>
                        % endfor
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>
</%def>